package cn.jjxx.modules.portal.dto;

import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;
import java.io.Serializable;

public class UserDto implements Serializable {

    /** 短信验证码 */
    @NotBlank(message = "验证码不能为空")
    private String vcode;
    /** 手机号码 */
    @NotBlank(message = "手机号码不能为空")
    private String phone;
    /** 密码 */
    @NotBlank(message = "密码不能为空")
    private String password;
    /** 用户类型 */
    //@NotBlank(message = "用户类型不能为空")
    @Pattern(regexp = "(individual|company)", message = "用户类型不合法")
    private String type;

    /** 角色code前缀 */
    private final static String ROLE_PREFIX = "portal_";

    /** 前台用户默认组织ID */
    public final static String PORTAL_ORG = "848ee580f16d4da683b15f02664fed6d";

    public String getVcode() {
        return vcode;
    }

    public void setVcode(String vcode) {
        this.vcode = vcode;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRoleCode() {
        return ROLE_PREFIX + this.type;
    }
}
